import Vue from 'vue'
import Router from 'vue-router'

const usertest = () => import('@/pages/user/user备份.vue');

//首页
// import index from '@/pages/index/index.vue');
//登陆
const bindOrRegister = () => import('@/pages/login/bindOrRegister');
const login = () => import('@/pages/login/login');
const register = () => import('@/pages/login/register.vue');
//个人中心
const user = () => import('@/pages/user/user.vue');
const Collection = () => import('@/pages/user/Collection.vue');
const Merchant = () => import('@/pages/user/Merchant.vue');//申请入驻
const AllOrders = () => import('@/pages/user/AllOrders.vue');//我的订单
const orderDetail = () => import('@/pages/user/orderDetail.vue'); //订单详情
const edit = () => import('@/pages/user/edit');
const changeDetail = () => import('@/pages/user/changeDetail');
const MyRecord = () => import('@/pages/user/MyRecord');
const STC = () => import('@/pages/user/STC');
const Bill = () => import('@/pages/user/Bill');

//农贸首页
const index = () => import('@/pages/commodity/commoditgyIndex.vue');
const allCategories = () => import('@/pages/commodity/allCategories.vue');
const About = () => import('@/pages/about/About.vue');

//备份
// const index = () => import('@/pages/commodity/commoditgyIndex.vue');
// const co = () => import('@/pages/commodity/commoditgyIndex.1.vue');
// const allCategories = () => import('@/pages/commodity/allCategories.vue');
// const About = () => import('@/pages/about/About.vue');

//分类
const moreSort = () => import('@/pages/commodity/moreSort.vue');
const sortDetail = () => import('@/pages/commodity/sortDetail.vue');

//商品
const commodity = () => import('@/pages/commodity/commodity.vue');//商品列表
const ProductDetails = () => import('@/pages/commodity/Product_details.vue');
const cart = () => import('@/pages/commodity/cart.vue');
const Shop = () => import('@/pages/commodity/Shop.vue');
const Store_dynamics = () => import('@/pages/commodity/Store_dynamics.vue');
const Commodity_evaluations = () => import('@/pages/commodity/Commodity_evaluations.vue');
const share = () => import('@/pages/commodity/share.vue');

//支付
const wxPay = () => import('@/pages/pay/wxPay');
const aliPay = () => import('@/pages/pay/aliPay');
//设置
const SetUp = () => import('@/pages/SetUp/SetUp');
const Language = () => import('@/pages/SetUp/Language.vue');
const Complaints = () => import('@/pages/SetUp/Complaints.vue');
const aboutMe = () => import('@/pages/SetUp/aboutMe.vue');
const Address = () => import('@/pages/SetUp/Address.vue');
const nesAddress = () => import('@/pages/SetUp/nesAddress.vue');
const EditAddress = () => import('@/pages/SetUp/EditAddress.vue');

//我的推荐
const myRecommended = () => import('@/pages/user/myRecommended');
const ShareRecords = () => import('@/pages/user/ShareRecords');
//服务规则
const serviceRules = () => import('@/components/serviceRules');
//分享领劵
const shareCoupons = () => import('@/pages/share/shareCoupons.vue');
// const xiazai = () => import('@/pages/about/xiazai.vue');

// 活动
// 秒杀
// const seckill = () => import('@/pages/activity/seckill/seckill');
// const seckCommodityDetail = () => import('@/pages/activity/seckill/commodityDetail');
// const orderForm = () => import('@/pages/activity/purchase/orderForm');
// const GMCommodityDetail = () => import('@/pages/activity/purchase/GMCommodityDetail');

// //9.9包邮
// const ninePieceIndex = () => import('@/pages/activity/ninePiece/ninePieceIndex');
// const nineCommodityDetail = () => import('@/pages/activity/ninePiece/commodityDetail');

// //拼团
// const groupBookingIndex = () => import('@/pages/activity/groupBooking/groupBookingIndex');
// const groupCommodityDetail = () => import('@/pages/activity/groupBooking/commodityDetail');
// const groupBookingDetail = () => import('@/pages/activity/groupBooking/groupBookingDetail');
// const groupBookingRecord = () => import('@/pages/activity/groupBooking/groupBookingRecord');
// const sharePal  = () => import('@/pages/activity/groupBooking/share');

// //分享领券
// const sTIndex  = () => import('@/pages/activity/shareTicket/sTIndex');
// const shareCOF  = () => import('@/pages/activity/shareTicket/shareCOF');
// // const text  = () => import('@/pages/activity/shareTicket/text');
// const stCommodityDetail = () => import('@/pages/activity/shareTicket/commodityDetail');



// const sTCommoditylist  = () => import('@/pages/activity/shareTicket/sTCommoditylist');
// const record  = () => import('@/pages/activity/shareTicket/record');
// const comdList  = () => import('@/pages/activity/shareTicket/comdList');


Vue.use(Router)
export default new Router({
    mode: 'history',
    // base: '/stcwx',
    // mode: 'hash',
    routes: [
        //首页
        {
            path: '/',
            name: 'index',
            component: index
        },
		{ path: '/index', name: 'index',component: index },
		// {
  //           path: '/co',
  //           name: 'co',
  //           component: co
  //       },
		{
            path: '/usertest',
            name: 'usertest',
            component: usertest
        },
		{
		    path: '/moreSort',
		    name: '商品分类',
		    component: moreSort
		},
		{
		    path: '/sortDetail',
		    name: '商品明细',
		    component: sortDetail
		},
		
      // {
      //   path: '/commoditgyIndex',
      //   name: 'commoditgyIndex',
      //   component: commoditgyIndex
      // },
        {
            path: '/bindOrRegister',
            name: '绑定注册',
            component: bindOrRegister,
        },
        {
            path: '/login',
            name: '登陆',
            component: login
        },
      {
        path: '/register',
        name: '注册',
        component: register
      },
        {
            path: '/user',
            name: '我的',
            component: user
        },
      {
        path: '/STC',
        name: 'STC',
        component: STC
      },
      {
        path: '/Bill',
        name: '账单',
        component: Bill
      },
      {
        path: '/share',
        name: '分享商品列表',
        component: share
      },
        //农贸
        {
            path: '/allCategories',
            name: '全部分类',
            component: allCategories
        },
        {
            path: '/commodity',
            name: '商品列表',
            component: commodity
        },
        {
            path: '/ProductDetails',
            name: '商品详情',
            component: ProductDetails
        },
        {
            path: '/Commodity_evaluations',
            name: '商品评价',
            component: Commodity_evaluations
        },
        {
            path: '/Store_dynamics',
            name: '店铺动态',
            component: Store_dynamics
        },
        {
            path: '/cart',
            name: '购物车',
            // meta: {
            //     requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            // },
            component: cart
        },
        {
            path: '/Shop',
            name: '商铺',
            component: Shop
        },
        {
            path: '/About',
            name: '搜索',
            component: About
        },
        //微信支付
        {
            path: '/wxPay',
            name: 'wxPay',
            meta: {
                requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            },
            component: wxPay,
        },
        {
            path: '/aliPay',
            name: 'aliPay',
            component: aliPay,
        },
        //  我的
        {
            path: '/SetUp',
            name: '设置',
            component: SetUp,
        },
        {
            path: '/Complaints',
            name: '投诉建议',
            component: Complaints,
        },
        {
            path: '/aboutMe',
            name: '关于我们',
            component: aboutMe,
        },
        {
            path: '/Language',
            name: '语言',
            component: Language,
        },
        {
            path: '/Address',
            name: '地址管理',
            component: Address,
        },
        {
            path: '/nesAddress',
            name: '新增地址',
            component: nesAddress,
        },
        {
            path: '/EditAddress',
            name: '编辑地址',
            component: EditAddress,
        },
        {
            path: '/myRecommended',
            name: 'myRecommended',
            component: myRecommended,
            meta: {
                requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            },
        },
        {
            path: '/Collection',
            name: '收藏',
            component: Collection,
        },
        {
            path: '/Merchant',
            name: '商家入驻',
            component: Merchant,
        },
      {
        path: '/AllOrders',
        name: '我的订单',
        component: AllOrders,
      },
      {
        path: '/MyRecord',
        name: '我的记录',
        component: MyRecord,
      },
        { //订单详情
            path: '/orderDetail',
            name: 'orderDetail',
            component: orderDetail
        },
        { //修改基本信息
            path: '/edit',
            name: 'edit',
            component: edit
        },
        { //零钱明细
            path: '/changeDetail',
            name: 'changeDetail',
            component: changeDetail
        },

        { //分享记录
            path: '/ShareRecords',
            name: 'ShareRecords',
            component: ShareRecords,
            meta: {
                requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            },
        },
      { //服务规则
        path: '/serviceRules',
        name: '租赁服务规则',
        component: serviceRules
      },
      { //分享领劵
        path: '/shareCoupons',
        name: '分享领劵',
        component: shareCoupons
      },
      // { //分享领劵
      //   path: '/xiazai',
      //   name: '下载',
      //   component: xiazai
      // },
	  
	  //活动
	  //秒杀主页
	  // {   
   //      path: '/seckill',
   //      name: 'seckill',
   //      component: seckill
   //    },
	  // { //详细
   //      path: '/seckCommodityDetail',
   //      name: 'seckCommodityDetail',
   //      component: seckCommodityDetail
   //    },
	  // { //通用订单
   //      path: '/orderForm',
   //      name: 'orderForm',
   //      component: orderForm
   //    },
	  // { //通用商品详细
   //      path: '/GMCommodityDetail',
   //      name: 'GMCommodityDetail',
   //      component: GMCommodityDetail
   //    },
	  
	  
	  // { //9.9包邮
   //      path: '/ninePieceIndex',
   //      name: 'ninePieceIndex',
   //      component: ninePieceIndex
   //    },
	  // { //详细
	  //   path: '/nineCommodityDetail',
	  //   name: 'nineCommodityDetail',
	  //   component:nineCommodityDetail
	  // },
	  // //拼团
	  // { //主页
	  //   path: '/groupBookingIndex',
	  //   name: 'groupBookingIndex',
	  //   component:groupBookingIndex
	  // },
	  // { //商品详细
	  //   path: '/groupCommodityDetail',
	  //   name: 'groupCommodityDetail',
	  //   component:groupCommodityDetail
	  // },
	  // { //拼团详细
	  //   path: '/groupBookingDetail',
	  //   name: 'groupBookingDetail',
	  //   component:groupBookingDetail
	  // },
	  // { //拼团记录
	  //   path: '/groupBookingRecord',
	  //   name: 'groupBookingRecord',
	  //   component:groupBookingRecord
	  // },
	  // { //分享朋友圈
	  //   path: '/sharePal',
	  //   name: 'sharePal',
	  //   component:sharePal
	  // },
	  // //分享领券
	  // { //主页
	  //   path: '/sTIndex',
	  //   name: 'sTIndex',
	  //   component:sTIndex
	  // },
	  // { //分享朋友圈
	  //   path: '/shareCOF',
	  //   name: 'shareCOF',
	  //   component:shareCOF
	  // },
	  // { //折扣商品详细
	  //   path: '/stCommodityDetail',
	  //   name: 'stCommodityDetail',
	  //   component:stCommodityDetail
	  // },
	  // { //分享朋友圈
	  //   path: '/text',
	  //   name: 'text',
	  //   component:text
	  // },
	 //  { //分享朋友圈
	 //    path: '/sTCommoditylist',
	 //    name: 'sTCommoditylist',
	 //    component:sTCommoditylist,
		// // ],
		// children:[
		// 	{ path: '/', component :record},
		// 	{ path: 'record',  name: 'record', component:record},
		// 	{ path: 'comdList',  name: 'comdList', component:comdList}
		//  ],
		 
	 //  },
	  
	  
    ]
})
